home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / mpss / header.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-20  |  3.0 KB  |  148 lines

  1.  
  2. /*******************************************************************************
  3. ********************************************************************************
  4. ********************************************************************************
  5.  
  6. PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
  7. THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
  8.  
  9.         P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
  10.  
  11.  
  12. ********************************************************************************
  13. ********************************************************************************
  14. *******************************************************************************/
  15.  
  16.  
  17. #include <stdio.h>
  18. #include <sys/ioctl.h>
  19. #include <sgtty.h>
  20. #include <signal.h>
  21.  
  22. #define STARTENERGY 500 
  23. #define STARTPHASER 15
  24. #define STARTPHOTON 10
  25. #define WEAPONREACH 6
  26. #define PHOTONPOWER 60
  27. #define PHASERPOWER 40
  28. #define MAXWARP 1
  29. #define FLAG 2 
  30. #define ON 1
  31. #define OFF 0
  32. #define ROMID 'R'
  33. #define KLINGID 'K'
  34. #define MAXALIENS 3
  35.  
  36.  
  37. struct sgttyb params;
  38.  
  39. char *tgoto();
  40. char *tgetstr();
  41. extern char *BC;
  42. extern char *UP;
  43. char bp[1024];
  44. char tbp[1024];
  45. char *termp;
  46.  
  47. /*variables for unbuffered input&output*/
  48. #define BUFSIZE 512
  49. long noofchars;
  50. /*variables for unbuffered input&output*/
  51.  
  52. /*variables for universe array*/
  53. struct thing  {
  54.         int x;
  55.         char c;
  56.         struct thing *next_thing;
  57.           };
  58.  
  59. struct thing *univ[918],*xp;
  60. /*variables for universe array*/
  61.  
  62. /*variables for the torpedos*/
  63. struct torpedo {
  64.         char weapon;
  65.         int life;
  66.         int xpos;
  67.         int ypos;
  68.         int oldxpos;
  69.         int oldypos;
  70.         int xvel;
  71.         int yvel;
  72.         struct player *whofrom;
  73.         struct torpedo *next;
  74.            };
  75.  
  76. struct torpedo *tstartlist,*ttaillist,*txp,*ta;
  77. /*variables for the torpedos*/
  78.  
  79. /*variables for a player*/
  80. struct player {
  81.     int reason;
  82.     char id; /*playing id*/
  83.     char buf[BUFSIZE]; /*persons input buffer*/
  84.     char message[57]; /*to radio others!*/
  85.     int messindex;
  86.     int buftop,bufptr; /*pointers to buffer for that person*/
  87.     char terminalfile[14];
  88.     char cm[20];
  89.     char cl[20];
  90.     int tty_type;
  91.     int shipno;
  92.     int fd; /*file descriptor to the tty file */
  93.     /*horizontal size of window, IT MUST BE AN ODD NO!*/
  94.     int pid; /*pid of process to be killed if this guy leaves the game*/
  95.     /* plus all the other stuff a player needs!!! */
  96.     int oldxpos;
  97.     int oldypos;
  98.     int xpos;
  99.     int ypos;
  100.     int xvel;
  101.     int yvel;
  102.     int maxvel;
  103.     int energy;
  104.     int maxenergy;
  105.     int cloakingdevice;
  106.     int beeping;
  107.     int phaserbanks;
  108.     int maxphaser;
  109.     int photontorpedos;
  110.     int maxphoton;
  111.     int photonreach;
  112.     int photonpower;
  113.     int phaserreach;
  114.     int phaserpower;
  115.     int weaponselect; /*0=phaser, 1=photon*/
  116.     int score;
  117.     int shields;
  118.     int oldstat;
  119.     int stat;
  120.     int chflg;
  121.     int clflg;
  122.     struct lock_on
  123.         {
  124.         struct player *enemy;
  125.         int xloc;
  126.         int yloc;
  127.         } channel[4];
  128.     int flyto;
  129.     int planets[30];
  130.     int planetno;
  131.     int doneit;
  132.     int impulsemove;
  133.     struct player *next;
  134.     };
  135.  
  136.     struct player *player,*startlist,*taillist;
  137.  
  138. int players[10];
  139. /*variables for a player*/
  140. int debug;
  141. int noofaliens,noofsignals,noofplayers;
  142.  
  143. /*global general usage variables*/
  144.  
  145. int v,i,j,z,r,k,l,x,y,storm;
  146. char c;
  147.  
  148.